export function fn(data) {
    let arr = [];
    function deep(data) {
        data.forEach(item => {
            if (!item.children.length) {
                // console.log(item, "item");
                let path = item.path.slice(0, 1).toUpperCase() + item.path.slice(1)
                arr.push({
                    path: '/' + item.path,
                    name: item.path,
                    component: () =>
                        import(`@/views/list/${path}.vue`)
                })
            } else {
                deep(item.children)
            }
        })
    }
    deep(data)  //调用递归
    return arr;
}
